package com.shujia.scala

object Demo21Tuple {
  def main(args: Array[String]): Unit = {

    val user: (String, Int, String) = ("张三", 23, "男")

    //元组：通过下划线取值，不会出现下标越界
    println(user._2)
    println(user._1)

    //构建二元组
    val info: (String, Int) = "张三" -> 23
    println(info)
  }
}